package cn.itcast.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class DemoAop {

    @Around("execution(* cn.itcast.service.DemoService*.*(..))")
    public Object xxx(ProceedingJoinPoint pjp)throws Throwable{

        long l = System.currentTimeMillis();
        Object proceed = pjp.proceed(pjp.getArgs());
        long l1 = System.currentTimeMillis();
        System.out.println(l1-l);
        return proceed;
    }

}
